<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1" import="java.sql.*"%>
<%
	String userName = request.getParameter("username");
	String password = request.getParameter("password");
	UserManager manager = new UserManager();
	String name_test= manager.checkLogin(userName,password);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@page import="storeMovie.Util.UserManager"%><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Insert title here</title>
<link href="style.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript">
	function load()
	{
		window.location = "Main.jsp";
	}
</script>
</head>
<body onload="setTimeout('load()', 2000)">
<div id="wrapper">
		<!-- inner tao khoang cach voi vien 2 ben -->
		<div id="inner">
			<div id="header">
				<!-- nen set width va height trong img, ko can phai de the div -->
				<h1><img src="images/logo.gif" width="519" height="63" alt="Online Movie Store" /></h1>
				<div id="nav">
                  <%
                  	String name= (String)session.getAttribute("userName");
                  	if (name==null){
                  %>
                  <a href="#" id="urAccount" title="Your account">your account</a> | <a href="#" id="cart" title="View your shop cart">view cart</a> | <a href="#" id="registry" title="click her if you want regis">Registry</a>
                  <%}else{ %>
					<%=name %> | <a href="#" id="cart" title="View your shop cart">view cart</a> | <a href="logout.jsp" id="help" title="click her if you want log out">Log out</a>                  	
                  <%} %>
                   
              	</div>
              	<!-- co the de img trong a, ko nhat thiet phai de trong the div -->
              	<a href="#"><img src="images/header_1.jpg" width="744" height="145" alt="Harry Potter cd" /></a>
              	<a href="#"><img src="images/header_2.jpg" width="745" height="48" alt="" /></a>
			</div><!-- end header -->
			<dl id="browse">
	              <dt>Full Category Lists</dt>
	              <dd class="first"><a href="#" id="1" onclick="fc2(this.id)">Action &amp; Adventure</a></dd>
	              <dd><a href="#" id="2" onclick="fc2(this.id)">Anime &amp; Manga</a></dd>
	              <dd><a href="#" id="3" onclick="fc2(this.id)" >Art House &amp; International</a></dd>
	              <dd><a href="#" id="4" onclick="fc2(this.id)">Classics</a></dd>
	              <dd><a href="#" id="5" onclick="fc2(this.id)">Comedy</a></dd>
	              <dd><a href="#" id="6" onclick="fc2(this.id)">Cult Movies</a></dd>
	              <dd><a href="#" id="7" onclick="fc2(this.id)">Drama</a></dd>
	              <dd><a href="#" id="8" onclick="fc2(this.id)">New &amp; Future Releases</a></dd>
	              <dd><a href="#" id="9" onclick="fc2(this.id)">Horror</a></dd>
	              <dd><a href="#" id="10" onclick="fc2(this.id)">Musicals</a></dd>
	              <dd><a href="#" id="11" onclick="fc2(this.id)">Mystery &amp; Suspense</a></dd>
	              <dd><a href="#" id="12" onclick="fc2(this.id)">Science Fiction &amp; Fantasy</a></dd>
	              <dd class="last"><a href="#" id="13" onclick="fc2(this.id)">Westerns</a></dd>

	              <dt>Search Your Favorite Movie</dt>
	              <dd class="searchform">
	                <form method="get" name="myForm" >
	                    <div><select name="cat" id="category">
	                        <option value="-" selected="selected">CATEGORIES</option>
	                        <option value="-">Action &amp; Adventure</option>
	                        <option value="-">Anime &amp; Manga</option>
	                        <option value="-">Art House &amp; International</option>
	                        <option value="-">Classics</option>
	                        <option value="-">Comedy</option>
	                        <option value="-">Cult Movies</option>
	                        <option value="-">Drama</option>
	                        <option value="-">New &amp; Future Releases</option>
	                        <option value="-">Horror</option>
	                        <option value="-">Musicals</option>
	                        <option value="-">Mystery &amp; Suspense</option>
	                        <option value="-">Science Fiction &amp; Fantasy</option>
	                        <option value="-">Western</option>
	                    </select></div>
	                    <div><input id="txtSearch"  name="search" type="text" value="DVD TITLE" class="text" onfocus="fc1()"/></div>
	                    <div class="softright"><input type="button" onclick="searchMoive()" value="OK"/></div>
	                </form>
	              </dd>
         	 </dl>
         	
              <div id="inner">
                  	<%
						if (("").equals(name_test)) {
					%>
					<h1 style="font-size: xx-large;text-align: center;">Login Fail</h1>
					<%
						} else {
					%>
					<h1  style="font-size: xx-large;text-align: center;">Login successfully.</h1> 
					<h1 style="font-size: xx-large;text-align: center;">Welcome <%=name_test%>
					<%session.setAttribute("userName",userName); %> 
					</h1>
					<h2 style="text-align: center;font-size: xx-large;">Prepare to be redirected!</h2>
					<h2 style="text-align: center;font-size: xx-large;">This page is a time delay redirect</h2>
					<%
						}
					%>
					<%
						/*try {
							if (psLogin != null) {
								psLogin.close();
							}
							if (conn != null) {
								conn.close();
							}
							if (rsUser != null) {
								rsUser.close();
							}
					
						} catch (Exception e) {
							e.printStackTrace();
						}*/
					%>
              </div><!-- end .inner -->
          </div><!-- end body -->
          <div class="clear"></div>
          <div id="footer">Web design by <a href="#">TienLM</a>&nbsp;
              <div id="footnav">
                  <a href="#">Legal</a> | <a href="#">Privacy Policy</a>
              </div><!-- end footnav -->
          </div><!-- end footer -->
		</div>	
</body>
</html>